import com.TanNgee.HelloService;
import com.TanNgee.config.RpcServiceConfig;
import com.TanNgee.remoting.transport.socket.SocketRpcServer;
import com.TanNgee.serviceimpl.HelloServiceImpl;

/**
 * @author 陈毅
 * @create 2022/3/23 15:56
 */
public class SocketServerMain {
    public static void main(String[] args) {
        HelloService helloService = new HelloServiceImpl();

        // 启动服务
        SocketRpcServer socketRpcServer = new SocketRpcServer();

        RpcServiceConfig rpcServiceConfig = new RpcServiceConfig();

        // 要提供RPC服务的类
        rpcServiceConfig.setService(helloService);

        // 对服务进行注册
        socketRpcServer.registerService(rpcServiceConfig);

        socketRpcServer.start();
    }
}
